import { defineConfig } from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import { resolve } from 'node:path';
import { fileURLToPath, URL } from 'node:url';

// https://vitejs.dev/config/
export default defineConfig(async () => {
    const UnoCss = await import('unocss/vite').then((i) => i.default);
    return {
        envDir: resolve(__dirname, 'env'),
        plugins: [
            //
            uni(),
            //
            UnoCss()
        ],
        resolve: {
            alias: {
                '@': fileURLToPath(new URL('./src', import.meta.url))
            }
        }
    };
});
